package com.qianzhou.eduCourseBoot.converter;

import com.qianzhou.eduCommon.dto.CourseLessonDTO;
import com.qianzhou.eduCommon.po.CourseLesson;
import com.qianzhou.eduCommon.vo.CourseLessonVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CourseLessonConverter {
    CourseLessonConverter INSTANCE = Mappers.getMapper(CourseLessonConverter.class);
    /**
     * 将对应的courseLesson转换为对应的CourseLessonVO
     */
    List<CourseLessonVO> poListConvertVoList(List<CourseLesson> courseLessons);
    @Mappings({
            @Mapping(source = "courseLesson.", target = ".")
    })
    CourseLessonVO poConvertVo(CourseLesson courseLesson);

    CourseLesson dtoConvertPo(CourseLessonDTO courseLessonDTO);
}
